package com.ipay.wechat.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.ipay.utils.R;
import com.ipay.wechat.pojo.PayChannelEntity;
import com.ipay.wechat.pojo.PayorderEntity;
import com.ipay.wechat.pojo.TPayresultEntity;

/**
 * 支付交易订单流水（支付、退款）
 * 
 * @author hacken
 * @email hacken_hu@163.com
 * @date 2017-06-13 20:11:53
 */
public interface PayorderService {

	PayorderEntity queryObject(String id);

	List<PayorderEntity> queryList(Map<String, Object> map);

	int queryTotal(Map<String, Object> map);

	void save(PayorderEntity payorder);

	R savePayOrder(PayorderEntity payorder,PayChannelEntity payChannel);
	R savePayNativeOrder(PayorderEntity payorder,PayChannelEntity payChannel);


	/**
	 * 平安支付发起支付接口
	 * @param payorder
	 * @param payChannel
	 * @return
	 */
	R paylist(PayorderEntity payorder,PayChannelEntity payChannel);

	void update(PayorderEntity payorder);
	void update(PayorderEntity payorder,TPayresultEntity entity);

	void delete(String id);

	void deleteBatch(String[] ids);

	public PayorderEntity queryByOderNo(String orderNo);

	/**
	 * 根据订单号查询 该订单对应的退款订单
	 * 
	 * @param orderNo
	 *            支付订单号
	 * @return
	 */
	public PayorderEntity queryByRelationOrder(String orderNo);

	/**
	 * 修改订单状态专用（定时器块）
	 * @param payorder
	 * @return
	 */
	void updateRefundStart(PayorderEntity payorder);

	/**
	 * 今日商户某个渠道交易金额
	 * @param map
	 * @return
	 */
	BigDecimal findTdSumAmountByPayChannelId(Map<String, Object> map);
}
